package com.wswy.wyjk.ui.practice.dialog

import android.content.Context
import android.os.Bundle
import android.support.v7.app.AppCompatDialog
import android.view.Window
import com.wswy.wyjk.R
import com.wswy.wyjk.model.SubjectType
import com.wswy.wyjk.model.vo.ExamRegularConfig
import kotlinx.android.synthetic.main.dialog_exam_hint.*

class ExamRegularHintDialog(context: Context,private val examRegularConfig: ExamRegularConfig) : AppCompatDialog(context) {


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        window?.requestFeature(Window.FEATURE_NO_TITLE)

        setCancelable(false)
        setCanceledOnTouchOutside(false)

        setContentView(R.layout.dialog_exam_hint)




        val sb = StringBuilder(examRegularConfig.carType.title)

        examRegularConfig.carType.typeAbbr?.let {
            sb.append("-${it}")
        }

        if (examRegularConfig.subjectType != SubjectType.CERTIFICATE){
            sb.append(" ").append(examRegularConfig.subjectType.title)
        }
        sb.append("，").append(examRegularConfig.pointDesc)

        tv_exam_regular.text = sb



        btn_next.setOnClickListener {
            dismiss()
        }
    }

}